DROP TABLE IF EXISTS jms_ods.yl_lmdm_sys_network_expand;
CREATE EXTERNAL TABLE jms_ods.yl_lmdm_sys_network_expand(
 ID bigint comment "",  --NUMBER(10)
 CODE string comment "网点编码",  --NVARCHAR2(30)
 NAME string comment "网点名称",  --NVARCHAR2(64)
 PARENT_NETWORK_ID bigint comment "父级网点id",  --NUMBER(10)
 PARENT_NETWORK_CODE string comment "父级网点编码",  --NVARCHAR2(30)
 PARENT_NETWORK_NAME string comment "父级网点名称",  --NVARCHAR2(64)
 IN_DISTRIBUTION_ID string comment "可交货转运中心id",  --NVARCHAR2(32)
 IN_DISTRIBUTION_CODE string comment "可交货转运中心编码",  --NVARCHAR2(50)
 IN_DISTRIBUTION_NAME string comment "可交货转运中心名称",  --NVARCHAR2(258)
 OUT_DISTRIBUTION_ID string comment "可派货转运中心id",  --NVARCHAR2(32)
 OUT_DISTRIBUTION_CODE string comment "可派货转运中心编码",  --NVARCHAR2(50)
 OUT_DISTRIBUTION_NAME string comment "可派货转运中心名称",  --NVARCHAR2(258)
 ENTREPOT_ID bigint comment "集散网点id",  --NUMBER(10)
 ENTREPOT_NAME string comment "集散网点名称",  --NVARCHAR2(128)
 SUBORDINATE_AGENT_NAME string comment "所属代理区名称",  --NVARCHAR2(64)
 SUBORDINATE_AGENT_ID string comment "所属代理区id",  --NVARCHAR2(50)
 SUBORDINATE_AGENT_CODE string comment "所属代理区code",  --NVARCHAR2(64)
 REGIONAL_ID bigint comment "大区id",  --NUMBER(10)
 REGIONAL_DESC string comment "大区名称",  --NVARCHAR2(64)
 PROVIDER_ID bigint comment "省份id",  --NUMBER(10)
 PROVIDER_DESC string comment "省份",  --NVARCHAR2(32)
 CITY_ID bigint comment "城市id",  --NUMBER(10)
 CITY_DESC string comment "城市名称",  --NVARCHAR2(32)
 AREA_ID bigint comment "区域id",  --NUMBER(10)
 AREA_DESC string comment "区域名称",  --NVARCHAR2(256)
 FIRST_CODE string comment "一段码",  --NVARCHAR2(32)
 SECOND_CODE string comment "二段码",  --NVARCHAR2(32)
 FIRST_AND_SECOND_CODE string comment "一二段码合并",  --NVARCHAR2(64)
 COUNTRY_CODE string comment "国家编码",  --NVARCHAR2(30)
 COUNTRY_DESC string comment "国家",  --NVARCHAR2(256)
 FINANCIAL_CENTER_ID bigint comment "对应财务中心id",  --NUMBER(10)
 FINANCIAL_CENTER_CODE string comment "对应财务中心编码",  --NVARCHAR2(30)
 FINANCIAL_CENTER_DESC string comment "对应财务中心名称",  --NVARCHAR2(256)
 FIRST_FRANCHISEE_ID bigint comment "一级加盟商id",  --NUMBER(10)
 FIRST_FRANCHISEE_CODE string comment "一级加盟商code",  --NVARCHAR2(64)
 FIRST_FRANCHISEE_NAME string comment "一级加盟商",  --NVARCHAR2(256)
 SECOND_FRANCHISEE_ID bigint comment "二级加盟商id",  --NUMBER(10)
 SECOND_FRANCHISEE_CODE string comment "二级加盟商code",  --NVARCHAR2(64)
 SECOND_FRANCHISEE_NAME string comment "二级加盟商",  --NVARCHAR2(256)
 LONGITUDE string comment "经度",  --NVARCHAR2(50)
 LATITUDE string comment "纬度",  --NVARCHAR2(50)
 CREATE_TIME timestamp comment "创建时间",  --DATE
 UPDATE_TIME timestamp comment "更新时间",  --DATE
 IS_DISTRIBUTION_CENTER tinyint comment "是否分拨中心标识:1是,2否",  --NUMBER(1)
 FIRST_SECOND_THIRD_CODE string comment "三段码合并",  --VARCHAR2(64)
 THIRD_CODE string comment "三段码",  --VARCHAR2(64)
 ENTREPOT_CODE string comment "集散网点编码",  --NVARCHAR2(32)
 TYPE_ID bigint comment "网点类型id"  --NUMBER(10)
 )
 COMMENT '基础网点信息合并'
 PARTITIONED BY (dt STRING COMMENT '更新/创建日期 (yyyy-MM-dd)')
 STORED AS PARQUET
 LOCATION '/dw/hive/jms_ods.db/external/yl_lmdm_sys_network_expand'
 TBLPROPERTIES (
 'discover.partitions'='false',
 'parquet.column.index.access'='true'
 );

MSCK REPAIR TABLE jms_ods.yl_lmdm_sys_network_expand;